package study.transaction.jdbc.dao.accountbase;

import lombok.SneakyThrows;
import study.transaction.jdbc.dao.BaseDao;

import java.sql.Connection;
import java.sql.PreparedStatement;

public class AccountBaseDao extends BaseDao {

    public AccountBaseDao(Connection connection) {
       super(connection);
    }

    @SneakyThrows
    public int insert(AccountBaseEO entity) {
        //
        String sql = "insert into account_base (ab_ub_id) value (?) ";
        //
        PreparedStatement pstmt = connection.prepareStatement(sql);
        //
        pstmt.setLong(1, entity.getAbUbId());
        //
        int size = pstmt.executeUpdate();

        return size;
    }
}
